<!--
 * @Description: 添加组件，蒙层对话框
 * @Author: youzi
 * @Date: 2020-05-20 14:11:14
 * @LastEditors: youzi
 * @LastEditTime: 2020-09-15 10:44:34
-->
<template>
  <a-modal
    centered
    title="详情"
    closable
    v-model="realVisible"
    :footer="null"
    @cancel="onClose"
    :maskClosable="false"
    :bodyStyle="bodyStyle"
    :width="600"
  >
    <a-form :form="form">
      <a-form-item v-bind="formItemLayout" label="订单状态">
        <span>{{ orderStatusMap[initRecord.orderStatus] }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="订单编号">
        <span>{{ initRecord.orderNo }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="就诊服务">
        <span>{{ initRecord.goodsName }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="联系人">
        <span>{{ initRecord.contactsName }}</span>
      </a-form-item> 
      <a-form-item v-bind="formItemLayout" label="电话">
        <span>{{ initRecord.phone }}</span>
      </a-form-item> 
      <a-form-item v-bind="formItemLayout" label="医院">
        <span>{{ initRecord.hospitalName }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="就诊时间">
        <span>{{ initRecord.visitTime }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="就诊备注">
        <span>{{ initRecord.visitRemark }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="单价">
        <span>{{ initRecord.orderPrice }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="数量">
        <span>{{ initRecord.orderCount }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="总价">
        <span>{{ initRecord.orderTotcalPrice }}</span>
      </a-form-item> 
      <a-form-item v-bind="formItemLayout" label="实付金额">
        <span>{{ initRecord.orderActualPayment }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="实付积分">
        <span>{{ initRecord.orderActualPaymentScore }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="支付方式">
        <span>{{ payTypeMap[initRecord.payType] }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="接单人">
        <span>{{ initRecord.orderReceiveUserName }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="接单时间">
        <span>{{ initRecord.orderReceiveTime }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="获取积分">
        <span>{{ initRecord.score }}</span>
      </a-form-item>
      <a-form-item v-bind="formItemLayout" label="创建时间">
        <span>{{ initRecord.createTime }}</span>
      </a-form-item> 
    </a-form>
  </a-modal>
</template>
<script>
const formItemLayout = {
  labelCol: { span: 4 },
  wrapperCol: { span: 16 }
};
export default {
  name: 'info',
  props: {
    // status:  [],
    visible: {
      default: false
    },
    initRecord: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      // formItem,
      formItemLayout,
      form: this.$form.createForm(this),
      // 0-已取消 1-待付款 2-待发货(已付款) 3-待收货(已发货) 4-待评价(已收货/发货10天后默认确认收货) 5-已完成(已评价/7天不评价默认五星好评)
      orderStatusMap: Object.freeze({
        '1': '待付款',
        '2': '订单超时',
        '3': '已支付',
        '4': '已取消',
        '5': '已退款',
        '6': '处理中',
        '7': '已服务',
        '8': '待评价',
        '9': '已完成'
      }),
      payTypeMap: Object.freeze({
        '1': '微信',
        '2': '支付宝'
      }),
    };
  },
  mounted() {},
  computed: {
    bodyStyle() {
      return {
        maxHeight: window.innerHeight * 0.8 + 'px',
        overflowY: 'scroll',
        padding: 0
      };
    },
    realVisible: {
      get() {
        return this.visible;
      },
      set(val) {
        return val;
      }
    }
  },
  methods: {
    onClose() {
      this.$emit('close');
    }
  },
  watch: {}
};
</script>
<style scoped>

</style>
